<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('报废信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse" style="display: none;">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>批号：</label>
                                <input type="text" name="lotId" id="lotId"/>
                            </li>
                            <li>
                                <label>工单号：</label>
                                <input type="text" name="moId" id="moId"/>
                            </li>
                            <li>
                                <label>订单号：</label>
                                <input type="text" name="customerOrder" id="customerOrder"/>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('promanage:scrapinfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('promanage:scrapinfo:remove')}]];
        var prefix = ctx + "promanage/scrapinfo";
        var lotId = [[${lotId}]];
        var moId = [[${moId}]];
        var customerOrder = [[${customerOrder}]];
        var columns = [
            {
                field: 'id',
                title: '编号',
                visible: false
            },
            {
                field: 'lotId',
                title: '批号'
            },
            {
                field: 'stepName',
                title: '工步名称'
            },
            {
                field: 'stage',
                title: '工段'
            },
            {
                field: 'partType',
                title: '产品类型'
            },
            {
                field: 'partName',
                title: '产品名称'
            },
            {
                field: 'procedureName',
                title: '模块名称'
            },
            {
                field: 'location',
                title: '区域'
            },
            {
                field: 'scrapComment',
                title: '报废备注'
            },
            {
                field: 'scrapTime',
                title: '报废时间'
            },
            {
                field: 'scrapQty',
                title: '报废片数'
            },
            {
                field: 'scrapCode',
                title: '报废码'
            },
            {
                field: 'scrapUser',
                title: '报废操作人'
            },
            {
                field: 'moId',
                title: '工单号'
            }
        ];
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "报废信息",
            sidePagination: "client",
            columns: columns
        };

        $(function() {
            if (null != lotId) {
                $("#lotId").attr("value", lotId);
            }
            if (null != customerOrder) {
                $("#customerOrder").attr("value", customerOrder);
            }
            if (null != moId) {
                $("#moId").attr("value", moId);
            }
            $.table.init(options);
        });
    </script>
</body>
</html>